package com.smartcruise.util;

import android.content.Context;
import android.widget.Toast;

/**
 * Created by FengChaoQun
 * on 2018/1/18 0018
 * Toast统一管理
 */
public class ToastUtils {
    // Toast
    private static Toast toast;

    public static void showShort(Context context, CharSequence message) {
        if (toast == null) {
            toast = Toast.makeText(context, message, Toast.LENGTH_SHORT);
        } else {
            toast.setText(message);
        }
        toast.show();
    }

    public static void hideToast() {
        if (null != toast) {
            toast.cancel();
        }
    }

}
